<template>
  <column :options="options" v-model:reduced="columns" />
</template>
<script setup>
import { ref } from 'vue'
import column from '@/components/icon-column-select/icon-column-select.vue'
import { useColumns } from './provide-context.js'
let columns = useColumns()
let options = ref([
  {
    title: '名称',
    dataIndex: 'dataName',
    key: 'dataName',
    fixed: 'left',
    width: 200,
    sorter: true,
    showSorterTooltip: {
      title: '按首字母排序',
    },
    // sortDirections: ['name-descend', 'name-ascend'],
  },
  {
    title: '文件类型',
    dataIndex: 'fileType',
    key: 'fileType',
    width: 150,
    sorter: true,
    showSorterTooltip: {
      title: '按首字母排序',
    },
    // // sortDirections: ['descend', 'ascend'],
    // filters: [
    //   { text: '文件类型1', value: '1' },
    //   { text: '文件类型2', value: '2' },
    //   { text: '文件类型3', value: '3' },
    // ],
    // filterMultiple: false,
    // filteredValue: null,
  },
  {
    title: '编码',
    dataIndex: 'fileCode',
    key: 'fileCode',
    width: 250,
    checked: false,
  },
  {
    title: '上传时间',
    dataIndex: 'gmtCreate',
    key: 'gmtCreate',
    width: 180,
    sorter: true,
    checked: false,
    // sortDirections: ['descend', 'ascend'],
  },
  {
    title: '版本',
    dataIndex: 'version',
    key: 'version',
    width: 100,
    sorter: true,
    // sortDirections: ['descend', 'ascend'],
  },
  {
    title: '修改时间',
    dataIndex: 'updatedTime',
    key: 'updatedTime',
    width: 180,
    sorter: true,
    // sortDirections: ['descend', 'ascend'],
  },
  {
    title: '状态',
    dataIndex: 'dataStatus',
    key: 'dataStatus',
    width: 100,
    filters: [
      { text: '已发布', value: 'publish' },
      { text: '占用', value: 'occupy' },
    ],
    filterMultiple: false,
    filteredValue: null,
  },
  {
    title: '备注',
    dataIndex: 'note',
    key: 'note',
    width: 200,
  },
  {
    title: '文件大小',
    dataIndex: 'fileSizeShow',
    key: 'fileSizeShow',
    width: 150,
    sorter: true,
    // sortDirections: ['descend', 'ascend'],
    showSorterTooltip: {
      title: '按大小排序',
    },
  },
  {
    title: '操作',
    dataIndex: 'operation',
    key: 'operation',
    fixed: 'right',
    width: 120,
  },
])
</script>
